<?php
use kartik\form\ActiveForm;
use yii\bootstrap\Html;
use wodrow\yii2wtools\tools\JsBlock;
use yii\helpers\Url;
use common\Tools;
/**
 * @var \yii\web\View $this
 * @var $custom \frontend\modules\custom\models\forms\Custom
 */
$bankCards = $custom->bankCards;
?>

<div>
    <table class="table table-bordered table-hover table-primary" style="margin-bottom: 0">
        <thead>
        <tr class="table-primary">
            <th>
                卡号
                <span><?=Html::a("绑定新卡", ['/user/center/bind-new-card'], ['class' => "btn btn-primary btn-xs"]) ?></span>
            </th>
            <th>开户行</th>
            <th>类型</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($bankCards as $k => $v): ?>
            <tr>
                <td><?=$v->card_no ?></td>
                <td>
                    [<?=$v->open_bank ?>]
                    <?=Yii::$app->fenZhangTong->getBankCodeNameMap()[$v->open_bank] ?>
                </td>
                <td><?=$v->getStatusDesc()[$v->status] ?></td>
                <td>
                    <?php if($v->status == $v::STATUS_DEFAULT): ?>
                    <?php else: ?>
                        <?=Html::a('设为结算卡', ["/user/center/set-settlement-card", 'card_id' => $v->id], ['class' => "btn btn-warning btn-xs", 'data-confirm' => "你确认设置该卡[{$v->card_no}]为结算银行卡吗？"]) ?>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
    <div class="clearfix"></div>
</div>